package com.hanamaki.operator.scanner;

import java.util.Scanner;

public class Scanner2 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
//        System.out.println("请输入整数：");
//        if (scanner.hasNextInt()) {
//            int i = scanner.nextInt();
//            System.out.println("整数数据：" + i);
//        } else {
//            System.out.println("不是整数");
//        }


        System.out.println("请输入小数：");
        if (scanner.hasNextFloat()) {
            Float i = scanner.nextFloat();
            System.out.println("小数数据：" + i);
        } else {
            System.out.println("不是小数");
        }
    }
}
